home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / src / tooltip.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  14.8 KB  |  519 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #include "stdafx.h"
  12. #if !defined(_WIN32_WCE_NO_TOOLTIPS)
  13.  
  14. #ifdef AFX_CMNCTL_SEG
  15. #pragma code_seg(AFX_CMNCTL_SEG)
  16. #endif
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. #define new DEBUG_NEW
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CToolTipCtrl
  27.  
  28. BEGIN_MESSAGE_MAP(CToolTipCtrl, CWnd)
  29.     //{{AFX_MSG_MAP(CToolTipCtrl)
  30.     ON_MESSAGE(WM_DISABLEMODAL, OnDisableModal)
  31.     ON_MESSAGE(TTM_WINDOWFROMPOINT, OnWindowFromPoint)
  32.     ON_MESSAGE(TTM_ADDTOOL, OnAddTool)
  33.     ON_WM_ENABLE()
  34.     //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36.  
  37. CToolTipCtrl::CToolTipCtrl()
  38. {
  39. }
  40.  
  41. BOOL CToolTipCtrl::Create(CWnd* pParentWnd, DWORD dwStyle)
  42. {
  43.     // initialize common controls
  44.     VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_BAR_REG));
  45.  
  46.     BOOL bResult = CWnd::CreateEx(NULL, TOOLTIPS_CLASS, NULL,
  47.         WS_POPUP | dwStyle, // force WS_POPUP
  48.         CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
  49.         pParentWnd->GetSafeHwnd(), NULL, NULL);
  50.  
  51.     if (bResult)
  52.         SetOwner(pParentWnd);
  53.     return bResult;
  54. }
  55.  
  56. CToolTipCtrl::~CToolTipCtrl()
  57. {
  58.     DestroyWindow();
  59. }
  60.  
  61. BOOL CToolTipCtrl::DestroyToolTipCtrl()
  62. {
  63. #ifdef _AFXDLL
  64.     BOOL bDestroy = (AfxGetModuleState() == m_pModuleState);
  65. #else
  66.     BOOL bDestroy = TRUE;
  67. #endif
  68.  
  69.     if (bDestroy)
  70.     {
  71.         DestroyWindow();
  72.         delete this;
  73.     }
  74.     return bDestroy;
  75. }
  76.  
  77. LRESULT CToolTipCtrl::OnAddTool(WPARAM wParam, LPARAM lParam)
  78. {
  79.     TOOLINFO ti = *(LPTOOLINFO)lParam;
  80.     if ((ti.hinst == NULL) && (ti.lpszText != LPSTR_TEXTCALLBACK)
  81.         && (ti.lpszText != NULL))
  82.     {
  83.         void* pv;
  84.         if (!m_mapString.Lookup(ti.lpszText, pv))
  85.             m_mapString.SetAt(ti.lpszText, NULL);
  86.         // set lpszText to point to the permanent memory associated
  87.         // with the CString
  88.         VERIFY(m_mapString.LookupKey(ti.lpszText, ti.lpszText));
  89.     }
  90.     return DefWindowProc(TTM_ADDTOOL, wParam, (LPARAM)&ti);
  91. }
  92.  
  93. LRESULT CToolTipCtrl::OnDisableModal(WPARAM, LPARAM)
  94. {
  95.     SendMessage(TTM_ACTIVATE, FALSE);
  96.     return FALSE;
  97. }
  98.  
  99. void CToolTipCtrl::OnEnable(BOOL bEnable)
  100. {
  101.     SendMessage(TTM_ACTIVATE, bEnable);
  102. }
  103.  
  104. LRESULT CToolTipCtrl::OnWindowFromPoint(WPARAM, LPARAM lParam)
  105. {
  106.     ASSERT(lParam != NULL);
  107.  
  108.     // the default implementation of tooltips just calls WindowFromPoint
  109.     // which does not work for certain kinds of combo boxes
  110.     CPoint pt = *(POINT*)lParam;
  111.     HWND hWnd = ::WindowFromPoint(pt);
  112.     if (hWnd == NULL)
  113.         return 0;
  114.  
  115.     // try to hit combobox instead of edit control for CBS_DROPDOWN styles
  116.     HWND hWndTemp = ::GetParent(hWnd);
  117.     if (hWndTemp != NULL && _AfxIsComboBoxControl(hWndTemp, CBS_DROPDOWN))
  118.         return (LRESULT)hWndTemp;
  119.  
  120.     // handle special case of disabled child windows
  121.     ::ScreenToClient(hWnd, &pt);
  122.     hWndTemp = _AfxChildWindowFromPoint(hWnd, pt);
  123.     if (hWndTemp != NULL && !::IsWindowEnabled(hWndTemp))
  124.         return (LRESULT)hWndTemp;
  125.  
  126.     return (LRESULT)hWnd;
  127. }
  128.  
  129. BOOL CToolTipCtrl::AddTool(CWnd* pWnd, LPCTSTR lpszText, LPCRECT lpRectTool,
  130.     UINT nIDTool)
  131. {
  132.     ASSERT(::IsWindow(m_hWnd));
  133.     ASSERT(pWnd != NULL);
  134.     ASSERT(lpszText != NULL);
  135.     // the toolrect and toolid must both be zero or both valid
  136.     ASSERT((lpRectTool != NULL && nIDTool != 0) ||
  137.            (lpRectTool == NULL) && (nIDTool == 0));
  138.  
  139.     TOOLINFO ti;
  140.     FillInToolInfo(ti, pWnd, nIDTool);
  141.     if (lpRectTool != NULL)
  142.         memcpy(&ti.rect, lpRectTool, sizeof(RECT));
  143.     ti.lpszText = (LPTSTR)lpszText;
  144.     return (BOOL) ::SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
  145. }
  146.  
  147. BOOL CToolTipCtrl::AddTool(CWnd* pWnd, UINT nIDText, LPCRECT lpRectTool,
  148.     UINT nIDTool)
  149. {
  150.     ASSERT(::IsWindow(m_hWnd));
  151.     ASSERT(nIDText != 0);
  152.     ASSERT(pWnd != NULL);
  153.     // the toolrect and toolid must both be zero or both valid
  154.     ASSERT((lpRectTool != NULL && nIDTool != 0) ||
  155.            (lpRectTool == NULL) && (nIDTool == 0));
  156.  
  157.     TOOLINFO ti;
  158.     FillInToolInfo(ti, pWnd, nIDTool);
  159.     if (lpRectTool != NULL)
  160.         memcpy(&ti.rect, lpRectTool, sizeof(RECT));
  161.     ti.hinst = AfxFindResourceHandle(MAKEINTRESOURCE((nIDText>>4)+1),
  162.         RT_STRING);
  163.     ASSERT(ti.hinst != NULL);
  164.     ti.lpszText = (LPTSTR)MAKEINTRESOURCE(nIDText);
  165.     return (BOOL) ::SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
  166. }
  167.  
  168. void CToolTipCtrl::DelTool(CWnd* pWnd, UINT nIDTool)
  169. {
  170.     ASSERT(::IsWindow(m_hWnd));
  171.     ASSERT(pWnd != NULL);
  172.  
  173.     TOOLINFO ti;
  174.     FillInToolInfo(ti, pWnd, nIDTool);
  175.     ::SendMessage(m_hWnd, TTM_DELTOOL, 0, (LPARAM)&ti);
  176. }
  177.  
  178. void CToolTipCtrl::GetText(CString& str, CWnd* pWnd, UINT nIDTool) const
  179. {
  180.     ASSERT(::IsWindow(m_hWnd));
  181.     ASSERT(pWnd != NULL);
  182.  
  183.     TOOLINFO ti;
  184.     FillInToolInfo(ti, pWnd, nIDTool);
  185.     ti.lpszText = str.GetBuffer(256);
  186.     ::SendMessage(m_hWnd, TTM_GETTEXT, 0, (LPARAM)&ti);
  187.     str.ReleaseBuffer();
  188. }
  189.  
  190. BOOL CToolTipCtrl::GetToolInfo(CToolInfo& ToolInfo, CWnd* pWnd,
  191.     UINT nIDTool) const
  192. {
  193.     ASSERT(::IsWindow(m_hWnd));
  194.     ASSERT(pWnd != NULL);
  195.  
  196.     FillInToolInfo(ToolInfo, pWnd, nIDTool);
  197.     ToolInfo.lpszText = ToolInfo.szText;
  198.     return (BOOL)::SendMessage(m_hWnd, TTM_GETTOOLINFO, 0, (LPARAM)&ToolInfo);
  199. }
  200.  
  201. BOOL CToolTipCtrl::HitTest(CWnd* pWnd, CPoint pt, LPTOOLINFO lpToolInfo) const
  202. {
  203.     ASSERT(::IsWindow(m_hWnd));
  204.     ASSERT(pWnd != NULL);
  205.     ASSERT(lpToolInfo != NULL);
  206.  
  207.     TTHITTESTINFO hti;
  208.     memset(&hti, 0, sizeof(hti));
  209.     hti.ti.cbSize = sizeof(AFX_OLDTOOLINFO);
  210.     hti.hwnd = pWnd->GetSafeHwnd();
  211.     hti.pt.x = pt.x;
  212.     hti.pt.y = pt.y;
  213.     if ((BOOL)::SendMessage(m_hWnd, TTM_HITTEST, 0, (LPARAM)&hti))
  214.     {
  215.         memcpy(lpToolInfo, &hti.ti, sizeof(AFX_OLDTOOLINFO));
  216.         return TRUE;
  217.     }
  218.     return FALSE;
  219. }
  220.  
  221. void CToolTipCtrl::SetToolRect(CWnd* pWnd, UINT nIDTool, LPCRECT lpRect)
  222. {
  223.     ASSERT(::IsWindow(m_hWnd));
  224.     ASSERT(pWnd != NULL);
  225.     ASSERT(nIDTool != 0);
  226.  
  227.     TOOLINFO ti;
  228.     FillInToolInfo(ti, pWnd, nIDTool);
  229.     memcpy(&ti.rect, lpRect, sizeof(RECT));
  230.     ::SendMessage(m_hWnd, TTM_NEWTOOLRECT, 0, (LPARAM)&ti);
  231. }
  232.  
  233. void CToolTipCtrl::UpdateTipText(LPCTSTR lpszText, CWnd* pWnd, UINT nIDTool)
  234. {
  235.     ASSERT(::IsWindow(m_hWnd));
  236.     ASSERT(pWnd != NULL);
  237.  
  238.     TOOLINFO ti;
  239.     FillInToolInfo(ti, pWnd, nIDTool);
  240.     ti.lpszText = (LPTSTR)lpszText;
  241.     ::SendMessage(m_hWnd, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
  242. }
  243.  
  244. void CToolTipCtrl::UpdateTipText(UINT nIDText, CWnd* pWnd, UINT nIDTool)
  245. {
  246.     ASSERT(nIDText != 0);
  247.  
  248.     CString str;
  249.     VERIFY(str.LoadString(nIDText));
  250.     UpdateTipText(str, pWnd, nIDTool);
  251. }
  252.  
  253. /////////////////////////////////////////////////////////////////////////////
  254. // CToolTipCtrl Implementation
  255.  
  256. void CToolTipCtrl::FillInToolInfo(TOOLINFO& ti, CWnd* pWnd, UINT nIDTool) const
  257. {
  258.     memset(&ti, 0, sizeof(AFX_OLDTOOLINFO));
  259.     ti.cbSize = sizeof(AFX_OLDTOOLINFO);
  260.     HWND hwnd = pWnd->GetSafeHwnd();
  261.     if (nIDTool == 0)
  262.     {
  263.         ti.hwnd = ::GetParent(hwnd);
  264.         ti.uFlags = TTF_IDISHWND;
  265.         ti.uId = (UINT)hwnd;
  266.     }
  267.     else
  268.     {
  269.         ti.hwnd = hwnd;
  270.         ti.uFlags = 0;
  271.         ti.uId = nIDTool;
  272.     }
  273. }
  274.  
  275. /////////////////////////////////////////////////////////////////////////////
  276. // CWnd tooltip support
  277.  
  278. BOOL CWnd::_EnableToolTips(BOOL bEnable, UINT nFlag)
  279. {
  280.     ASSERT(nFlag == WF_TOOLTIPS || nFlag == WF_TRACKINGTOOLTIPS);
  281.  
  282.     _AFX_THREAD_STATE* pThreadState = AfxGetThreadState();
  283.     CToolTipCtrl* pToolTip = pThreadState->m_pToolTip;
  284.  
  285.     if (!bEnable)
  286.     {
  287.         // nothing to do if tooltips not enabled
  288.         if (!(m_nFlags & nFlag))
  289.             return TRUE;
  290.  
  291.         // cancel tooltip if this window is active
  292.         if (pThreadState->m_pLastHit == this)
  293.             CancelToolTips(TRUE);
  294.  
  295.         // remove "dead-area" toolbar
  296.         if (pToolTip->GetSafeHwnd() != NULL)
  297.         {
  298.             TOOLINFO ti; memset(&ti, 0, sizeof(TOOLINFO));
  299.             ti.cbSize = sizeof(AFX_OLDTOOLINFO);
  300.             ti.uFlags = TTF_IDISHWND;
  301.             ti.hwnd = m_hWnd;
  302.             ti.uId = (UINT)m_hWnd;
  303.             pToolTip->SendMessage(TTM_DELTOOL, 0, (LPARAM)&ti);
  304.         }
  305.  
  306.         // success
  307.         m_nFlags &= ~nFlag;
  308.         return TRUE;
  309.     }
  310.  
  311.     // if already enabled for tooltips, nothing to do
  312.     if (!(m_nFlags & nFlag))
  313.     {
  314.         // success
  315.         AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE();
  316.         pModuleState->m_pfnFilterToolTipMessage = &CWnd::_FilterToolTipMessage;
  317.         m_nFlags |= nFlag;
  318.     }
  319.     return TRUE;
  320. }
  321.  
  322. BOOL CWnd::EnableToolTips(BOOL bEnable)
  323. {
  324.     return _EnableToolTips(bEnable, WF_TOOLTIPS);
  325. }
  326.  
  327. BOOL CWnd::EnableTrackingToolTips(BOOL bEnable)
  328. {
  329.     return _EnableToolTips(bEnable, WF_TRACKINGTOOLTIPS);
  330. }
  331.  
  332. AFX_STATIC void AFXAPI _AfxRelayToolTipMessage(CToolTipCtrl* pToolTip, MSG* pMsg)
  333. {
  334.     // transate the message based on TTM_WINDOWFROMPOINT
  335.     MSG msg = *pMsg;
  336.     msg.hwnd = (HWND)pToolTip->SendMessage(TTM_WINDOWFROMPOINT, 0, (LPARAM)&msg.pt);
  337.     CPoint pt = pMsg->pt;
  338.     if (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST)
  339.         ::ScreenToClient(msg.hwnd, &pt);
  340.     msg.lParam = MAKELONG(pt.x, pt.y);
  341.  
  342.     // relay mouse event before deleting old tool
  343.     pToolTip->SendMessage(TTM_RELAYEVENT, 0, (LPARAM)&msg);
  344. }
  345.  
  346. void PASCAL CWnd::_FilterToolTipMessage(MSG* pMsg, CWnd* pWnd)
  347. {
  348.     pWnd->FilterToolTipMessage(pMsg);
  349. }
  350.  
  351. void CWnd::FilterToolTipMessage(MSG* pMsg)
  352. {
  353.     // this CWnd has tooltips enabled
  354.     UINT message = pMsg->message;
  355.     if ((message == WM_MOUSEMOVE || message == WM_NCMOUSEMOVE ||
  356.          message == WM_LBUTTONUP || message == WM_RBUTTONUP ||
  357.          message == WM_MBUTTONUP) &&
  358.         (GetKeyState(VK_LBUTTON) >= 0 && GetKeyState(VK_RBUTTON) >= 0 &&
  359.          GetKeyState(VK_MBUTTON) >= 0))
  360.     {
  361.         // make sure that tooltips are not already being handled
  362.         CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd);
  363.         while (pWnd != NULL && !(pWnd->m_nFlags & (WF_TOOLTIPS|WF_TRACKINGTOOLTIPS)))
  364.         {
  365.             pWnd = pWnd->GetParent();
  366.         }
  367.         if (pWnd != this)
  368.         {
  369.             if (pWnd == NULL)
  370.             {
  371.                 // tooltips not enabled on this CWnd, clear last state data
  372.                 _AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();
  373.                 pThreadState->m_pLastHit = NULL;
  374.                 pThreadState->m_nLastHit = -1;
  375.             }
  376.             return;
  377.         }
  378.  
  379.         _AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();
  380.         CToolTipCtrl* pToolTip = pThreadState->m_pToolTip;
  381.         CWnd* pOwner = GetParentOwner();
  382.         if (pToolTip != NULL && pToolTip->GetOwner() != pOwner)
  383.         {
  384.             pToolTip->DestroyWindow();
  385.             delete pToolTip;
  386.             pThreadState->m_pToolTip = NULL;
  387.             pToolTip = NULL;
  388.         }
  389.         if (pToolTip == NULL)
  390.         {
  391.             pToolTip = new CToolTipCtrl;
  392.             if (!pToolTip->Create(pOwner, TTS_ALWAYSTIP))
  393.             {
  394.                 delete pToolTip;
  395.                 return;
  396.             }
  397.             pToolTip->SendMessage(TTM_ACTIVATE, FALSE);
  398.             pThreadState->m_pToolTip = pToolTip;
  399.         }
  400.  
  401.         ASSERT_VALID(pToolTip);
  402.         ASSERT(::IsWindow(pToolTip->m_hWnd));
  403.  
  404.         // add a "dead-area" tool for areas between toolbar buttons
  405.         TOOLINFO ti; memset(&ti, 0, sizeof(TOOLINFO));
  406.         ti.cbSize = sizeof(AFX_OLDTOOLINFO);
  407.         ti.uFlags = TTF_IDISHWND;
  408.         ti.hwnd = m_hWnd;
  409.         ti.uId = (UINT)m_hWnd;
  410.         if (!pToolTip->SendMessage(TTM_GETTOOLINFO, 0, (LPARAM)&ti))
  411.         {
  412.             ASSERT(ti.uFlags == TTF_IDISHWND);
  413.             ASSERT(ti.hwnd == m_hWnd);
  414.             ASSERT(ti.uId == (UINT)m_hWnd);
  415.             VERIFY(pToolTip->SendMessage(TTM_ADDTOOL, 0, (LPARAM)&ti));
  416.         }
  417.  
  418.         // determine which tool was hit
  419.         CPoint point = pMsg->pt;
  420.         ::ScreenToClient(m_hWnd, &point);
  421.         TOOLINFO tiHit; memset(&tiHit, 0, sizeof(TOOLINFO));
  422.         tiHit.cbSize = sizeof(AFX_OLDTOOLINFO);
  423.         int nHit = OnToolHitTest(point, &tiHit);
  424.  
  425.         // build new toolinfo and if different than current, register it
  426.         CWnd* pHitWnd = nHit == -1 ? NULL : this;
  427.         if (pThreadState->m_nLastHit != nHit || pThreadState->m_pLastHit != pHitWnd)
  428.         {
  429.             if (nHit != -1)
  430.             {
  431.                 // add new tool and activate the tip
  432.                 ti = tiHit;
  433.                 ti.uFlags &= ~(TTF_NOTBUTTON|TTF_ALWAYSTIP);
  434.                 if (m_nFlags & WF_TRACKINGTOOLTIPS)
  435.                     ti.uFlags |= TTF_TRACK;
  436.                 VERIFY(pToolTip->SendMessage(TTM_ADDTOOL, 0, (LPARAM)&ti));
  437.                 if ((tiHit.uFlags & TTF_ALWAYSTIP) || IsTopParentActive())
  438.                 {
  439.                     // allow the tooltip to popup when it should
  440.                     pToolTip->SendMessage(TTM_ACTIVATE, TRUE);
  441.                     if (m_nFlags & WF_TRACKINGTOOLTIPS)
  442.                         pToolTip->SendMessage(TTM_TRACKACTIVATE, TRUE, (LPARAM)&ti);
  443.  
  444.                     // bring the tooltip window above other popup windows
  445.                     ::SetWindowPos(pToolTip->m_hWnd, HWND_TOP, 0, 0, 0, 0,
  446.                         SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);
  447.                 }
  448.             }
  449.             else
  450.             {
  451.                 pToolTip->SendMessage(TTM_ACTIVATE, FALSE);
  452.             }
  453.  
  454.             // relay mouse event before deleting old tool
  455.             _AfxRelayToolTipMessage(pToolTip, pMsg);
  456.  
  457.             // now safe to delete the old tool
  458.             if (pThreadState->m_lastInfo.cbSize >= sizeof(AFX_OLDTOOLINFO))
  459.                 pToolTip->SendMessage(TTM_DELTOOL, 0, (LPARAM)&pThreadState->m_lastInfo);
  460.  
  461.             pThreadState->m_pLastHit = pHitWnd;
  462.             pThreadState->m_nLastHit = nHit;
  463.             pThreadState->m_lastInfo = tiHit;
  464.         }
  465.         else
  466.         {
  467.             if (m_nFlags & WF_TRACKINGTOOLTIPS)
  468.             {
  469.                 POINT pt;
  470.  
  471.                 ::GetCursorPos( &pt );
  472.                 pToolTip->SendMessage(TTM_TRACKPOSITION, 0, MAKELPARAM(pt.x, pt.y));
  473.             }
  474.             else
  475.             {
  476.                 // relay mouse events through the tooltip
  477.                 if (nHit != -1)
  478.                     _AfxRelayToolTipMessage(pToolTip, pMsg);
  479.             }
  480.         }
  481.  
  482.         if ((tiHit.lpszText != LPSTR_TEXTCALLBACK) && (tiHit.hinst == 0))
  483.             free(tiHit.lpszText);
  484.     }
  485.     else if (m_nFlags & (WF_TOOLTIPS|WF_TRACKINGTOOLTIPS))
  486.     {
  487.         // make sure that tooltips are not already being handled
  488.         CWnd* pWnd = CWnd::FromHandle(pMsg->hwnd);
  489.         while (pWnd != NULL && pWnd != this && !(pWnd->m_nFlags & (WF_TOOLTIPS|WF_TRACKINGTOOLTIPS)))
  490.             pWnd = pWnd->GetParent();
  491.         if (pWnd != this)
  492.             return;
  493.  
  494.         BOOL bKeys = (message >= WM_KEYFIRST && message <= WM_KEYLAST) ||
  495.             (message >= WM_SYSKEYFIRST && message <= WM_SYSKEYLAST);
  496.         if ((m_nFlags & WF_TRACKINGTOOLTIPS) == 0 &&
  497.             (bKeys ||
  498.              (message == WM_LBUTTONDOWN || message == WM_LBUTTONDBLCLK) ||
  499.              (message == WM_RBUTTONDOWN || message == WM_RBUTTONDBLCLK) ||
  500.              (message == WM_MBUTTONDOWN || message == WM_MBUTTONDBLCLK) ||
  501.              (message == WM_NCLBUTTONDOWN || message == WM_NCLBUTTONDBLCLK) ||
  502.              (message == WM_NCRBUTTONDOWN || message == WM_NCRBUTTONDBLCLK) ||
  503.              (message == WM_NCMBUTTONDOWN || message == WM_NCMBUTTONDBLCLK)))
  504.         {
  505.             CWnd::CancelToolTips(bKeys);
  506.         }
  507.     }
  508. }
  509.  
  510. /////////////////////////////////////////////////////////////////////////////
  511.  
  512. #ifdef AFX_INIT_SEG
  513. #pragma code_seg(AFX_INIT_SEG)
  514. #endif
  515.  
  516. IMPLEMENT_DYNAMIC(CToolTipCtrl, CWnd)
  517.  
  518. /////////////////////////////////////////////////////////////////////////////
  519. #endif // _WIN32_WCE_NO_TOOLTIPS